import 'package:json_annotation/json_annotation.dart';
import 'package:xindong/manager/xindong_user_controller.dart';
import 'package:xindong/models/user/xindong_other_user.dart';
import 'package:xindong/routes/tab_moments/model/xindong_comment_class.dart';
import 'package:xindong/models/xindong_crown_class.dart';

part 'xindong_dongtai_class.g.dart';

@JsonSerializable()
class XinDongDongTaiClass extends XinDongOtherUser {
  late String dy_id;
  late String category_id;
  String? fabu_city; // 发布城市
  String? type; // 类型
  late String content; // 内容
  late String voice;
  late String video;
  late String cover;
  String? comments; // 评论数
  String? noble_circle; // 会员头像框
  late int isthumbsup; // 是否点赞
  late String thumbsup; // 点赞数
  late String visit; // 浏览数
  late String addtime; // 发布时间
  late List<String> sumbImage;
  late List<String> masterimg;
  List<XinDongCommentClass>? text;

  bool get isMine {
    return XinDongUserController.to.loginId == uid;
  }

  XinDongDongTaiClass();

  factory XinDongDongTaiClass.fromJson(Map<String, dynamic> json) => _$XinDongDongTaiClassFromJson(json);

  @override
  Map<String, dynamic> toJson() => _$XinDongDongTaiClassToJson(this);
}
